using namespace std;
#ifndef _CIRCLE_H_H_
#define _CIRCLE_H_H_

#include "PointH.h"
#include "RectangleH.h"
#include <iostream>
#include<ostream>
#include<istream>
#include <Windows.h>
#include "ScreenH.h"
#include "Shape.h"
#include <math.h>
#include <array>
#include <string>


void gotoxy(int, int);

static enum{PRECISION = 3};

class Circle: public Shape
{
	//If Adding Data members, Please remember to update the operator assignment "="
	int m_Radius;
	Point m_center;

public:	
	//Constructors
    Circle()
	{
	   init();
	}
	Circle(const Circle& copyObj) { *this = copyObj; }; //Copy Constructor

	Circle& operator=(const Circle& copyObj);

	void init();

	//Serialization

	void saveToFile(ofstream& outf, boolean binary=false);
	
	void saveToBinFile(ofstream& outf) ;

	void loadFromFile(ifstream& istr, boolean binary=false);

	void saveToTextFile(ofstream& outf ) ;

	void loadFromTextFile(ifstream& outf);

	void loadFromBinFile(ifstream& inf);
	


	//Setters
	void setSize(int x);

	void setRadius(int x){m_Radius = x;}

	void setPos(int x, int y);

	//Getters
	void getSize(int &x);

	int getRadius()const{return m_Radius;}

	Point getPointCenter()const{return m_center;};

	int getXCenter()const{return m_center.getx();}
	
	int getYCenter()const{return m_center.gety();}

	void getPos(int &x, int &y);
	
	void getCirclePoints(Point &p1, Point &p2, Point &p3, Point &p4);
	
	void getCirclePoints4(Point &p1, Point &p2, Point &p3, Point &p4);

	bool getHitPoint(Circle * c2, Point &pHit);

	void get8Points(int CircleX, int CircleY, int x, int y, Point &p1, Point &p2, Point &p3, Point &p4);

	void get4Points(int CircleX, int CircleY, int x, int y, Point &p1, Point &p2, Point &p3, Point &p4);

	//Functionality
	void print4Points ( double x, double y, double currXAxis, double currYAxis, int modFactorX, int modFactorY, Screen * scr, bool split, char symb);

	void draw(int drawingOption = 0, Screen * s = NULL);

	void drawWithSpaces(Screen * s = NULL);

	void drawPoints8(int circleX, int circleY, int x, int y, int drawingOption, Screen * s);

	void drawPoints4(int circleX, int circleY, int x, int y, int drawingOption, Screen * s);

	bool isPointIn(const Point& p1) const;

	bool isInScreen(int x, int y);

	bool isInsideScreen();

    bool isDirectionsResetBorders();

	bool isDirectionsResetBordersCirclesPerPoint(Circle * c, Point p);

	bool isContain(Circle * c2);
	
    bool isOverlap(Circle * c2);

	bool isPointEqual4Points(Point pCheck, Point p1, Point p2, Point p3, Point p4);

	bool isPointInCircleEnvelop(const Point &p1, Circle * c2);

	bool isXaxis(Point p);

	bool isYaxis(Point p);

	bool isPointIn(int x, int y);
		
	virtual string getType()const{return "Circle";}


	
	



};

#endif